<if condition="$type neq 3">
<table class="table table-hover p-table">
          <thead>
          <tr>
              <th>文件名</th>
              <th>大小</th>
              <th>上传者</th>
              <th>上传日期</th>
              <th>操作</th>
          </tr>
          </thead>
          <tbody>
          		<?php if(empty($data)) {?>  
                  <tr><td style="text-align: center;" colspan="5">查询不到相关数据</td></tr> 
              <?php }?>  
           <foreach name="data" item="v" key="k">
              <tr>
                  <td>
                      <span class="fileStyle fileStyle-{$v.ext}"></span>
                      <a>{$v.name}</a>
                  </td>
                  <td>{$v.size}M</td>
                  <td>{$v.upload}</td>
                  <td>{$v.add_time|date='Y-m-d H:i',###}</td>
                  <td>
                      <a href="{:U('Bim/downLink',array('filename'=>$v['mname'],'name'=>$v['name'],'id'=>$v['id']))}" class="btn btn-primary btn-xs"><i class="icon-download-alt"></i>下载</a>
                      <span class="btn btn-danger btn-xs" onclick="dell('{$v.mname}',{$v.id})"><i class="icon-trash"></i>删除</span>
                  </td>
              </tr>
             </foreach>
          </tbody>
</table>
<else/>
    <div class="panel-body">
        <ul class="listBasicBlock">
            <foreach name="data" item="v" key="k">
                <li>
                    <a href="javascript:;" i="{:U('Index/himg',array('filename'=>$v['mname']))}" class="SlideImg">
                        <img src="{:U('Index/himg',array('filename'=>$v['mname']))}" />
                        <div class="SlideImgHide"><i class="glyphicon glyphicon-search"></i></div>
                    </a>
                    <div class="ImgBotInline">
                        <div class="InlineFont">大小: <span>{$v.size}M</span></div>
                        <div class="InlineFont">上传者: <span>{$v.upload}</span></div>
                        <div class="InlineFont">上传日期:</div>
                        <div class="InlineFont text-center">{$v.add_time|date='Y-m-d H:i',###}</div>
                    </div>
                    <div class="ImgBotInline">
                        <div class="ImgBotInlineHalf">
                            <a href ="{:U('Bim/downLink',array('filename'=>$v['mname'],'name'=>$v['name'],'id'=>$v['id']))}" class="btn btn-primary btn-xs"><i class="icon-download-alt"></i>下载</a>
                        </div>
                        <div class="ImgBotInlineHalf">
                            <span class="btn btn-danger btn-xs" onclick="dell('{$v.mname}',{$v.id})"><i class="icon-trash"></i>删除</span>
                        </div>
                    </div>
                    <div class="ImgBotInline">
                        <div class="ImgBotInlineWhole">
                          <if condition="$image eq $v['mname']">
              		  		<a class="btn btn-success btn-xs" ><i class="icon-star"></i>当前形象照片</a>
              		   <else/>
                              <a class="btn btn-default btn-xs" onclick="himg('{$v.mname}')"><i class="icon-star-empty"></i>设为形象照片</a>
                           </if>
                        </div>
                    </div>
                </li>
            </foreach>
        </ul>
    </div>
</if>
<div class="row">
  <div class="col-xs-12 text-center">{$page}</div>
</div>
<if condition="$type eq 3">
  <link href="__PUBLIC__/css/animate.css" rel="stylesheet" />
  <script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>  
  <script src="__PUBLIC__/js/simple.slide.min.js" type="text/javascript"></script>
  <script type="text/javascript">
      var $j = jQuery.noConflict(true);
      $j('.SlideImg').simpleSlide({
          "opacity": 0.6,                  //背景透明度
          "imageAction": "rollIn",      //图片进入动画
          "loadingImage":"../../../Public/images/loading.gif"      //加载图片
      });
  </script>    
 </if>
<script>
  $(".pagination a").click(function(){
      var page = $(this).data('p');
      ajaxgover({$cid},page);
  });
  
//文件删除
  function dell(obj,id){
	if(obj){
		layer.confirm('删除后不可恢复,确定删除吗?', {
     		  btn: ['确定','取消'] //按钮
     		}, function(){
		 $.ajax({
	          type : "POST",
	          url:'__URL__/delFile',
	          data : {filename:obj,id:id},
	          dataType : 'json',
	          success: function(res){
	        	  if(res.status==0){
						layer.alert(res.info, {icon: 2});
						return;
					 }
		 			 if(!res.errNo){
		 				 layer.msg(res.msg,{icon:1});
		 				 ajaxgover({$cid});
			          }else{
			        	 layer.msg(res.msg,{icon:2});
			          }
	          }
	      });
   		}, function(){
    			// 取消
    		});
    			return false;
	}
}
	//设置形象照片
	  function himg(name){
		if(name == ''){
			layer.msg('数据获取错误,请刷新重试',{icon:2});
		}
		if(name){
			layer.confirm('确定设置为形象照片吗?', {
	     		  btn: ['确定','取消'] //按钮
	     		}, function(){
			 $.ajax({
		          type : "POST",
		          url:'__URL__/simg',
		          data : {name:name},
		          dataType : 'json',
		          success: function(res){
		        	     if(res.status==0){
							layer.alert(res.info, {icon: 2});
							return;
						 }
			 			 if(!res.errNo){
			 				 layer.msg(res.msg,{icon:1});
			 				 ajaxgover({$cid});
				          }else{
				        	 layer.msg(res.msg,{icon:2});
				          }
		          }
		      });
	   		}, function(){
	    			// 取消
	    		});
	    			return false;
		}
 }
 </script> 
